<?php
/**
 * Sección indice de orquestamesta
 * @author Sahib J. Leo
 */
require '../../config.php';
require PATH . 'classes/ofj-orm/Director.php';
$css_arr = array(
  'css/orquesta/orquesta.css',
  'css/orquesta/sidebar_menu.css',
  'css/orquesta/directores/directores.css'
);
$js_arr = array();
require PATH . 'layout/header.php';
require PATH . 'orquesta/sidebar_menu.php';

$Director = false;
$director_id = isset($_GET['id']) ? (int)$_GET['id'] : 0;
$Director = Director::instance()->findById($director_id);

if(!$Director){
  die('Director no encontrado');
}

$old_directores_lang = Lang::setSource('directores');
?>
<div id="musicians_secction">
  <h1 id="directores" class="bottom_bordered">
    <span><?php echo Lang::get('directors') ?></span>
    <?php echo Lang::get('of_orchestra') ?>
  </h1>
  <h2 id="actual_director" class="clearfix">
    <div class="caret"></div>
    <?php echo strtoupper($Director->nombre. ' '. $Director->apellidos) ?>
    <span> / <?php echo Lang::get('since'), ' ', $Director->getPeriodo() ?></span>
    <a class="btn_back" href="orquesta/directores/">
      <?php echo Lang::get('back_to_list') ?>
      <img src="img/orquesta/directores/back.png" />
    </a>
  </h2>
  <img class="director_img"
    src="<?php echo Director::getImageUrl($Director->id) ?>" align="left" />
  <?php echo $Director->get('bio'); ?>
  <br clear="all" />
  <div id="social_buttons" class="clearfix">
    <div id="btn_gplus">
      <g:plusone size="small"></g:plusone>
      <div class="g-plus" data-action="share" data-annotation="none" data-height="15"></div>
      <script type="text/javascript">
        <?php if(LANG == 'es'): ?>
        window.___gcfg = {lang: 'es'};
        <?php endif ?>
        (function() {
          var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
          po.src = 'https://apis.google.com/js/plusone.js';
          var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
        })();
      </script>
    </div>
    <div id="btn_facebook">
      <div class="fb-like"
        data-href="<?php echo BASE, 'orquesta/directores/detalle.php?id=', $Director->id ?>"
        data-send="true"
        data-width="200"
        data-layout="button_count"
        data-show-faces="false"></div>
      <div id="fb-root"></div>
      <script>(function(d, s, id) {
        var js, fjs = d.getElementsByTagName(s)[0];
        if (d.getElementById(id)) return;
        js = d.createElement(s); js.id = id;
        <?php if(LANG == 'es'): ?>
        js.src = "//connect.facebook.net/es_LA/all.js#xfbml=1";
        <?php else: ?>
        js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
        <?php endif ?>
        fjs.parentNode.insertBefore(js, fjs);
      }(document, 'script', 'facebook-jssdk'));</script>
    </div>
    <a class="btn_back" href="orquesta/directores/">
      <?php echo Lang::get('back_to_list') ?>
      <img src="img/orquesta/directores/back.png" />
    </a>
  </div>
</div>
<?php
Lang::setSource($old_directores_lang);
require PATH . 'layout/footer.php';